import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity('dict')
export class Dict {

    @PrimaryGeneratedColumn({
        comment: "主键"
    })
    id: number //主键

    @Column({
        type: 'varchar',
        name:"type_code",
        length: 64,
        comment: '字典类型编码',
        nullable: true
    })
    typeCode: string;


    @Column({
        type: 'varchar',
        length: 50,
        comment: '字典项名称',
        nullable: true
    })
    name: string;


    @Column({
        type: 'varchar',
        length: 50,
        comment: '字典项值',
        nullable: true
    })
    value: string;

    @Column({
        type: 'int',
        comment: '排序',
        nullable: true,
        default: 0
    })
    sort: number;

    @Column({
        type: 'tinyint',
        comment: '状态(1:正常;0:禁用)',
        default: 0,
        nullable: true,
    })
    status: number; //状态(0:正常;1:禁用)


 

    @Column({
        type: 'varchar',
        comment: "备注",
        nullable: true,
        default: '',
    })
    remark: string; //备注

    @Column({
        name: 'create_time',
        type: 'timestamp',
        default: () => 'CURRENT_TIMESTAMP',
        comment: '创建时间',
    })
    createTime: Date; //用户创建时间

    @Column({
        name: 'update_time',
        type: 'timestamp',
        default: () => 'CURRENT_TIMESTAMP',
        comment: '更新时间'
    })
    updateTime: Date; //用户信息更新时间


}
